//
//  HNSH_GroupChatInfoMoreFooterView.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/17.
//

#import "HNSH_GroupChatInfoMoreFooterView.h"

@interface HNSH_GroupChatInfoMoreFooterView ()
/** */
@property (nonatomic, strong)UIButton * moreBtn;
@end

@implementation HNSH_GroupChatInfoMoreFooterView

//MARK: Cycle Methods
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor appWhiteLabelColor];
        [self addAllViews];
        [self addAllLayout];
    }
    return self;
}

//MARK: Myself Methods
- (void)addAllViews{
    [self addSubview:self.moreBtn];
}

- (void)addAllLayout{
    [self.moreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(self);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
    }];
}

- (void)moreBtnAction{
    if (self.moreBlock) {
        self.moreBlock();
    }
}

//MARK: Getter Methods
- (UIButton *)moreBtn{
    if (!_moreBtn) {
        _moreBtn = [UIButton new];
        [_moreBtn setTitle:@"查看更多群成员 " forState:UIControlStateNormal];
        [_moreBtn setTitleColor:[UIColor colorWithHexString:@"#666666"] forState:UIControlStateNormal];
        [_moreBtn setImage:[UIImage imageNamed:@"chat_qun_icon_left_more"] forState:UIControlStateNormal];
        _moreBtn.titleLabel.font = [UIFont systemFontOfSize:12];
        _moreBtn.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
        [_moreBtn addTarget:self action:@selector(moreBtnAction) forControlEvents:UIControlEventTouchUpInside];
    }
    return _moreBtn;
}

@end
